//
//  Ref.cpp
//  TestRef
//
//  Created by huge on 2021/6/22.
//

#include <stdio.h>
#include <iostream>
int  a=4;

int  &f(int  x)

{    a=a+x;
    
    return  a;
    
}

int main(void)

{
    int   t=5;
    
    std::cout<<f(t)<<std::endl;  //a = 9
    
    f(t)=20;             //a = 20
    
    std::cout<<f(t)<<std::endl;    // t = 5,a = 20  a = 25
    
    t=f(t);               // a = 30 t = 30
    
    std::cout<<f(t)<<std::endl;    //  t = 60

}
